import { Column, Model, Table, DataType, ForeignKey, CreatedAt } from 'sequelize-typescript';

//@Table

// 去掉时间字段：https://blog.csdn.net/qq_46506007/article/details/129558537
// https://blog.csdn.net/qq_36850813/article/details/89641846
//timestamps: false,
@Table({ tableName: 'fruit', timestamps: false })
export class User extends Model {

  @Column({
    type: DataType.INTEGER,
    primaryKey: true,
    //autoIncrement: true,
    //unique: true,
    //field: 'id',
  })
  //@Column
  id: number;

  @Column({
    type: DataType.STRING,
    allowNull: true,
  })
  name: string;
/*
  @Column({ defaultValue: true })
  isActive: boolean;*/

  /*//   @ForeignKey(() => User)
  @Column({
    type: DataType.INTEGER,
    allowNull: true,
  })
  userId: number; // 用户id，外键引用 User 模型*/

  /*@CreatedAt
  @Column
  createdAt: Date;

  @UpdatedAt
  @Column
  updatedAt: Date;

  @DeletedAt
  @Column
  deletedAt: Date;*/
}